<?php

class validaUsuario
{
	public static function verificaLogado()
	{
		@session_start();
		if(!isset($_SESSION['email']) && !isset($_SESSION['iduser'])&& !isset($_SESSION['nome']))
		{
			session_destroy();
			$_SESSION = array();
			redirect('valida');
		}
	}
	
	
	public static function isLogged()
	{
		@session_start();
		if(!isset($_SESSION['email']) && !isset($_SESSION['iduser'])&& !isset($_SESSION['nome']))
		{
			return false;
		}
		else
			return true;
	}
	
	
	public static function logout()
	{
		@session_start();
		session_destroy();
		$_SESSION = array();
		redirect('valida');
	}
	
}

?>